﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class nick_default : Base
{
    protected void Page_Load(object sender, EventArgs e)
    {
        BindData();
    }

    public void BindData()
    {
        string sql = "";
        //分类
        if (base.TypeID > 0)
            sql += string.Format(" Classification like '%,{0},%' and ", base.TypeID);
        //颜色
        if (base.ColorID > 0)
            sql += string.Format(" Color like '%,{0},%' and ", base.ColorID);
        //语言
        if (Language > 0)
            sql += string.Format("Lang='{0}' and ", base.GetLanguage(Language));
        if (sql.Length > 0) sql = sql.Substring(0, sql.Length - 4);
        BLL.V_NetName bll = new BLL.V_NetName();
        Model.PageData data = bll.GetList(50, base.pageIndex, sql, " AddTime desc");
        Repeater1.DataSource = data.DataSoure;
        Repeater1.DataBind();
        pgServer.RecordCount = data.Count;
        pgServer.EnableUrlRewriting = true;

        string url = string.Format("list-{0}-{1}-{2}.html", base.TypeID, base.ColorID, base.Language);
        pgServer.UrlRewritePattern = url + "?page={0}";
        pgServer.DataBind();
    }
}